package main

import (
	"fmt"
	"sysinfo/syspkg"
)

/**
 * Show the information of current system.
 * 1. Operation System Information.
 * 2. Current date time.
 * 3. Current user, work path.
 */
func main() {
	sysInfoCtx := new(syspkg.SysInfoCtx)
	doChain(sysInfoCtx, generateKenerlInfo, generateUbuntuInfo, generateTimeInfo, generateWorkInfo)
	output(sysInfoCtx)
}

func output(sysInfoCtx *syspkg.SysInfoCtx) {
	colorReset := "\033[0m"
	colorRed := "\033[31m"
	colorGreen := "\033[32m"
	colorBlue := "\033[34m"
	colorWhite := "\033[37m"
	fmt.Println(string(colorRed), "")
	fmt.Println("Current time:   " + sysInfoCtx.CurrentTime)
	fmt.Println(string(colorBlue), "")
	fmt.Println("Current User:   " + sysInfoCtx.CurrentUser)
	fmt.Println("Current path:   " + sysInfoCtx.CurrentPath)
	fmt.Println(string(colorGreen), "")
	fmt.Println(sysInfoCtx.UbuntuInfo)
	fmt.Println(string(colorWhite), "")
	fmt.Println(sysInfoCtx.LinuxInfo)
	fmt.Println(string(colorRed), "")
	fmt.Println("           _                   _       ")
	fmt.Println("      __ _(_)_   _        __ _(_)_   _ ")
	fmt.Println("     / _` | | | | |_____ / _` | | | | |")
	fmt.Println("    | (_| | | |_| |_____| (_| | | |_| |")
	fmt.Println("     \\__, |_|\\__,_|      \\__, |_|\\__,_|")
	fmt.Println("     |___/               |___/         ")
	fmt.Println(string(colorReset))
}